import React, { memo } from "react";
import Titletag from "@/components/titletag";
import { useHistory } from "react-router-dom";
import { Recommendwrap } from "./style";
export default memo(function Recommend(props) {
  const history = useHistory();
  return (
    <Recommendwrap>
      <Titletag imp={"推荐"} other={"文章 NEW Blog"}></Titletag>
      <div className="content1">
        <img
          src="http://www.lmlblog.com/winter/uploads/allimg/160206/1-160206150424-lp.png"
          alt=""
        />
        <div className="right">
          {props.blog.length > 0 &&
            props.blog.slice(0, 3).map((item, index) => (
              <div
                className="topblog"
                key={index}
                onClick={(e) =>
                  history.push(`/home/aesthetic/aesathedetail/${item.bgid}`)
                }
              >
                <div className="top">{item.title.slice(0, 8)}</div>
                <div className="bottom">
                  {item.summary.length > 16
                    ? item.summary.slice(0, 14) + "..."
                    : item.summary}
                </div>
              </div>
            ))}
        </div>
      </div>
    </Recommendwrap>
  );
});
